home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, curpath, mymem, curdrive, filex, isinroot, diskready
-
- on beginSprite me
- mymem = sprite(spriteNum).member
- filex = 0
- filex = new(xtra("FileXtra4"))
- getdrives()
- curpath = EMPTY
- mymem.scrollTop = 0
- sprite(spriteNum).locH = -400
- sprite(spriteNum).locZ = 700
- isinroot = 1
- end
-
- on getdrives me
- mymem.text = EMPTY
- folders = filex.fx_VolumesToList()
- repeat with i in folders
- mymem.text = mymem.text & i & RETURN
- end repeat
- mymem.scrollTop = 0
- isinroot = 1
- end
-
- on getfiles me
- mtext = ".." & RETURN
- files = filex.fx_FolderToList(curpath)
- topp = EMPTY
- bott = EMPTY
- if listp(files) then
- repeat with i in files
- if the platform contains "Mac" then
- if i.char[i.chars.count] = ":" then
- topp = topp & i & RETURN
- else
- bott = bott & i & RETURN
- end if
- next repeat
- end if
- if i.char[i.chars.count] = "\" then
- topp = topp & i & RETURN
- next repeat
- end if
- bott = bott & i & RETURN
- end repeat
- mtext = mtext & topp & bott
- mymem.text = mtext
- mymem.scrollTop = 0
- end if
- isinroot = 0
- end
-
- on mouseWithin me
- if spriteNum = the rollover then
- hilite mymem.line[the mouseLine]
- end if
- end
-
- on selectfilee filen, frames
- selectfile(filen, frames)
- end
-
- on mouseUp me
- delim = the itemDelimiter
- if the platform contains "Mac" then
- the itemDelimiter = ":"
- else
- the itemDelimiter = "\"
- end if
- currentLine = member(mymem).line[the mouseLine]
- if currentLine = ".." then
- itemcount = the number of items in curpath
- newpath = EMPTY
- repeat with i = 1 to itemcount - 2
- newpath = newpath & curpath.item[i] & the itemDelimiter
- end repeat
- curpath = newpath
- if curpath.items.count > 1 then
- getfiles()
- else
- curpath = EMPTY
- getdrives()
- end if
- else
- if isinroot then
- curdrive = currentLine.char[1]
- diskready = baDiskInfo(curdrive, "size") > 0
- end if
- if diskready then
- lepath = curpath & currentLine
- if lepath.char[lepath.chars.count] = the itemDelimiter then
- curpath = lepath
- getfiles()
- else
- if baFileExists(lepath) then
- sprite(180).locH = -400
- sprite(181).locH = -400
- sprite(165).visible = 1
- sprite(165).locZ = 999
- tell sprite(165)
- go("aan")
- end tell
- updateStage()
- tell sprite(165)
- sprite(25).import(lepath)
- end tell
- tell sprite(165)
- sprite(3).rect = rect(0, 1, 128, 97)
- end tell
- end if
- end if
- end if
- end if
- member("file_path_head").text = curpath
- the itemDelimiter = delim
- end
-